#pragma once
#include<pthread.h>
class Cond{
Cond()
{
    pthread_cond_init(&_cond,nullptr);
    pthread_mutex_lock(&_mutex);
}
void Wait()
{
    pthread_cond_wait(&_cond,&_mutex);
}
void Sigal()
{
pthread_cond_signal(&_cond);
}
void Broadcast()
{
pthread_cond_broadcast(&_cond);
}
~Cond()
{
    pthread_mutex_destroy(&_mutex);
    pthread_cond_destroy(&_cond);
}

    private:
    pthread_cond_t _cond;
pthread_mutex_t _mutex;
};